<?php echo $this->render('header.phtml'); ?>
<?php echo $this->render('menu.phtml'); ?>

<div id="contenido">
<h2><?php echo $this->escape($this->subtitle); ?></h2>

<?php if ($this->usuarioLogueado): ?>
    <p><a href="<?php echo $this->baseUrl; ?>/menu/menu/agregar">Agregar ítem</a></p>
<?php endif; ?>

    <table>
    <tr>
        <th>id</th>
        <th>Item</th>
         <th>Destino</th>
         <th>Privado</th>
         <th>Estado</th>
         <th>Posición</th>

    <?php if ($this->usuarioLogueado): ?>
         <th colspan="3">Acciones</th>
    <?php endif; ?>

    </tr>
    <?php
    foreach( $this->menu as $items ) : ?>
            <tr>
                <td><?php echo $this->escape($items->idMenu);?></td>
                <td><?php echo $this->escape($items->item);?></td>
                <td><a href="<?php echo $this->baseUrl . $this->escape($items->destino);?>"><?php echo $this->escape($items->destino);?></a></td>

                <td align="center"><img border="0" src="<?php echo $this->baseUrl ?>/public/images/estado_<?php echo $items->privado; ?>.png" /></td>

                <td align="center"><img border="0" src="<?php echo $this->baseUrl ?>/public/images/estado_<?php echo $items->estado; ?>.png" /></td>

                <td><?php echo $this->escape($items->posicion);?></td>

                <?php if ($this->usuarioLogueado): ?>
                    <td><a href="<?php echo $this->baseUrl; ?>/menu/menu/ver/idMenu/<?php echo $items->idMenu;?>">Ver</a></td>
                    <td><a href="<?php echo $this->baseUrl; ?>/menu/menu/modificar/idMenu/<?php echo $items->idMenu;?>">Modificar</a></td>
                    <td><a href="<?php echo $this->baseUrl; ?>/menu/menu/eliminar/idMenu/<?php echo $items->idMenu;?>">Eliminar</a></td>
                <?php endif; ?>

            </tr>
    <?php endforeach; ?>
    </table>

<?php if ($this->usuarioLogueado): ?>
    <p><a href="<?php echo $this->baseUrl; ?>/menu/menu/agregar">Agregar ítem</a></p>
<?php endif; ?>

</div>

<?php echo $this->render('footer.phtml'); ?>